/**
 * Created by shenhai on 15/9/11.
 */



var logService = require('../../../services/mis/system/logService');
var messageUtil = require('../../../common/utils/messageUtil');
var toolUtil = require('../../../common/utils/toolUtil');

exports.logList = function(req, res) {

    logService.logListService(req, function(err, results) {

        if (err) {
            logger.error('Exception happen when logList...' + err.message);
            res.json(messageUtil.composeFailedMessage(req, 'Exception happen when logList...'));
        }else {
            var data = {
                count:results[0]["count"],
                totalPage: results[0]["totalPage"],
                list: results[1]
            };
            res.json(messageUtil.composeSucceededMessage(req, null, data));
        }

    });
};



exports.logDelete = function(req, res) {

    logService.logDeleteService(req, function(err, results) {

        if (err) {
            logger.error('Exception happen when userDelete...' + err.message);
            res.json(messageUtil.composeFailedMessage(req, 'Exception happen when userDelete...'));
        }else {
            var data = {};
            res.json(messageUtil.composeSucceededMessage(req, null, data));
        }

    });
};

